<template>
  <!-- 顶部搜索框模块 -->
  <view class="sear">
    <u-search
      placeholder="请搜索"
      v-model="keys"
      shape="round"
      :clearabled="true"
      :show-action="false"
      bgColor="white"
      color="#BFBFBF"
      @search="searchs"
      @clickIcon="searchMD"
    ></u-search>
  </view>
</template>

<script>
export default {
  data() {
    return {
      keys: this.keyword,
    };
  },
  props: {
    keyword: "",
  },
  methods: {
    searchMD() {
      console.log(this.keys, "this.keys");
      this.$emit("search", this.keys);
      uni.navigateTo({
        url: "/packageA/search/index",
      });
    },
    searchs() {
      uni.navigateTo({
        url: "/packageA/search/detail",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.sear {
  width: 100%;
  margin: 10rpx auto;
}
</style>
